import moduleRegist from '@/utils/moduleRegist';
import { module as HomeModule } from './module';

const Layout = resolve => { require(['./Layout'], resolve); };
const Home = resolve => { require(['./Home'], resolve); };

export default [
  /** 配置管理路由 */
  {
    path: 'homeCenter',
    redirect: 'homeCenter/home',
    component: Layout,
    meta: {
      title: '首页',
      name: '首页',
      permission: 'auth:common',
      componentName: 'ConfigpayerLayout',
      keepAlive: true,
      icon: '',
      show: false
    },
    beforeEnter: (to, from, next) => {
      moduleRegist(HomeModule);
      next();
    },
    children: [
      {
        path: 'home',
        component: Home,
        meta: {
          title: '首页',
          name: '首页',
          breadcrumb: '首页',
          permission: 'auth:common',
          keepAlive: false,
          componentName: 'ConfigpayerListView',
          icon: ''
        }
      }
    ]
  }
];
